<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        
        <h4>Select datacenter location</h4>
<p>Select the datacenter where your instance will be created. When you are experimenting with a free VPS, you should choose the datacenter closer to your location.</p>
<div id="attachment_3124" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-002-1x.png?resize=1024%2C759" alt="Select the closest datacenter" class="size-large wp-image-3124" data-recalc-dims="1" /><p class="wp-caption-text">Select the closest datacenter</p></div>
<h4>Use the Elastic Compute (EC2) service</h4>
<p>Access the <em>Elastic Compute</em> service. Click on &#8220;EC2&#8221; in the upper-left corner of the AWS portal page.</p>
<div id="attachment_3123" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i0.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-001-1x.png?resize=1024%2C759" alt="Select the EC2 service" class="size-large wp-image-3123" data-recalc-dims="1" /><p class="wp-caption-text">Select the EC2 service</p></div>
<h4>Choose base image</h4>
<p>Click on big &#8220;Launch instance&#8221; button. You will see the available instance types. Note: you can upload your own if you need to, but that is another topic.</p>
<div id="attachment_3125" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-003-1x.png?resize=1024%2C759" alt="AWS3" class="size-large wp-image-3125" data-recalc-dims="1" /><p class="wp-caption-text">Click on big &#8220;Launch instance&#8221; button</p></div>
<p>Click on the &#8220;Free-tier only&#8221; check box to show the images available for the free micro-instance option we are using.</p>
<div id="attachment_3126" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i0.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-004-1x.png?resize=1024%2C759" alt="AWS4" class="size-large wp-image-3126" data-recalc-dims="1" /><p class="wp-caption-text">Select instance type</p></div>
<h4>HVM or PV?</h4>
<p>When selecting and instance, pay attention to whether it is an <em>HVM</em> instance or a <em>PV</em> instance. This is usually indicated in parenthesis at the end of the instance name. To understand the difference between HVM instances and PV instances, see the <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html">Amazon AWS virtualization types section</a> of the AWS documentation.</p>
<p>The summary is that HVM is probably the best instance type for most users. Choose HVM.</p>
<h4>Select instance type</h4>
<p>Choose the default instance type, <em>t2.micro</em>, which is eligible for the free tier of service. Then, click on the &#8220;Next: Configure Instance Details&#8221; button at the bottom left of the page.</p>
<div id="attachment_3127" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-005-1x.png?resize=1024%2C759" alt="AWS005" class="size-large wp-image-3127" data-recalc-dims="1" /><p class="wp-caption-text">Select micro instance</p></div>
<p>Use all the default settings. Click on the &#8220;Review and Launch&#8221; button.</p>
<div id="attachment_3128" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-006-1x.png?resize=1024%2C759" alt="AWS-006" class="size-large wp-image-3128" data-recalc-dims="1" /><p class="wp-caption-text">Click on the &#8220;Review and Launch&#8221; button</p></div>
<h4>Launch the instance</h4>
<p>Review settings and launch the instance. For now, ignore the security warning. Depending on how you plan to use your instance you may wish to set stronger security setting.</p>
<p>Click on the &#8220;Launch&#8221; button.</p>
<div id="attachment_3129" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-007-1x.png?resize=1024%2C759" alt="AWS007" class="size-large wp-image-3129" data-recalc-dims="1" /><p class="wp-caption-text">Click on the &#8220;Launch&#8221; button</p></div>
<h4>Download private key</h4>
<p>You will be asked to select a key pair that the instance will use to identify the legitimate user who connects to it via SSH when it is running.</p>
<p>A key pair consists of a public key that AWS stores, and a private key file that you store. Together, they allow you to connect to your instance securely. The private key file allows you to securely SSH into your instance.<sup id="rf1-3082"><a href="#fn1-3082" title="from AWS web site pop-up window" rel="footnote">1</a></sup></p>
<p>Choose the &#8220;Create a new key pair&#8221; option from the menu options, then give the key pair a name.</p>
<p>Then click on &#8220;Download Key Pair&#8221;. Save the file to your hard drive.</p>
<div id="attachment_3132" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-010-1x.png?resize=1024%2C759" alt="AWS010" class="size-large wp-image-3132" data-recalc-dims="1" /><p class="wp-caption-text">Click on &#8220;Download Key Pair&#8221;</p></div>
<p>Make a note of the directory in which you chose to store the key pair file because you will need it later. In my case, I put it in my <em>Documents</em> folder so the full path of the file is: <em>~/Documents/Ubuntu-2-keypair.pem</em>.</p>
<p>Finally, click on the &#8220;Launch Instances&#8221; button.</p>
<h4>Secure key pair file permissions</h4>
<p>Set permissions for the key. SSH will not allow you to the key pair file unless the file permissions are secure.</p>
<p>Navigate to the file in the File Manager, right-click on the file and select <em>Properties</em> from the drop-down menu. In the <em>properties</em> dialogue box, click on the <em>Permissions</em> tab. Change the user permissions to &#8220;Read Only&#8221;. Change group access permissions to &#8220;None&#8221; and Others access to &#8220;None&#8221;. Then click the &#8220;Close&#8221; button.</p>
<div id="attachment_3136" style="width: 416px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-014x.png?resize=406%2C459" alt="AWS014" class="size-full wp-image-3136" data-recalc-dims="1" /><p class="wp-caption-text">Click the &#8220;Close&#8221; button</p></div>
<p>Alternatively, use the terminal and enter the command:</p>
<pre><code>$ cd ~/Documents
$ sudo chmod 400 Ubuntu-2-keypair.pem
</code></pre>
<h4>Manage instances</h4>
<p>After you clicked on the &#8220;Launch Instances&#8221; button, the instance started launching. To manage instances, click the &#8220;view Instance&#8221; button.</p>
<div id="attachment_3133" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-011-1x.png?resize=1024%2C788" alt="AWS011" class="size-large wp-image-3133" data-recalc-dims="1" /><p class="wp-caption-text">Click the &#8220;view Instance&#8221; button</p></div>
<p>See the instances you have created in the AWS Console. In my case I have two instances: one I created earlier and the one I created just now, which is initializing.</p>
<div id="attachment_3134" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i1.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-012-1x.png?resize=1024%2C788" alt="AWS012" class="size-large wp-image-3134" data-recalc-dims="1" /><p class="wp-caption-text">Instance is initializing</p></div>
<p>Wait until the status of the instance changes to &#8220;running&#8221;, then log into it.</p>
<h3>Log in to the VPS</h3>
<p>we can log into a running instance using the SSH protocol. SSH comes built-in on Linux and Mac OS X. To access the instance from a Windows PC, install the free <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Putty</a> program.</p>
<p>To log into the VPS, we need to know the IP address assigned to the instance. Click on the check box next to the instance to view information about it.</p>
<div id="attachment_3135" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i1.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-013-1x.png?resize=1024%2C788" alt="AWS013" class="size-large wp-image-3135" data-recalc-dims="1" /><p class="wp-caption-text">View information about the instance</p></div>
<p>In this example, we see the public IP address is: 54.175.34.164. Note that, if we stop this instance and start it again, it will be assigned a different IP address (and DNS name).</p>
<p>See the Amazon AWS documentation for <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html">accessing AWS Linux instances</a> to see more details</p>
<h4>Use SSH</h4>
<p>Login to instance using the key pair file we generated and downloaded. As you recall, in this case we named the file <em>Ubuntu-2-keypair.pem</em> and saved it in the <em>Documents</em> folder.</p>
<p>In the terminal, enter the following command:</p>
<pre><code>$ ssh -i ~/Documents/Ubuntu-2-keypair.pem ubuntu@54.175.34.164
</code></pre>
<p>Note that the userid configured on the instance by default is <em>ubuntu</em>. You will see a security warning. Ignore it and respond &#8220;yes&#8221;.</p>
<pre><code>The authenticity of host '54.175.34.164 (54.175.34.164)' can't be established.
ECDSA key fingerprint is cc:94:f4:d6:95:4e:75:aa:f2:86:c6:94:9e:0f:c9:0f.
Are you sure you want to continue connecting (yes/no)? 
</code></pre>
<p>Now we have access to the Ubuntu Linux Bash shell running on the VPS in Amazon&#8217;s datacenter. In future posts we will explore using this VPS to run open-source network simulation software.</p>
<h4>Stop the instance</h4>
<p>If you want to stop the instance so that you do not consume the free hours provided as part of the Free Tier option, follow the procedure shown below.</p>
<p>First, exit the instance</p>
<pre><code>$ exit
</code></pre>
<p>Now, stop the instance in a way that saves the changes we have made so we can use them when we start it again.</p>
<p>On the Console web page, select the instance we are running and then click on the &#8220;Actions&#8221; button. Select &#8220;Instance State&#8221; from the drop-down window and select &#8220;Stop&#8221;.</p>
<div id="attachment_3138" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i1.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-016-1x.png?resize=1024%2C788" alt="AWS-16" class="size-large wp-image-3138" data-recalc-dims="1" /><p class="wp-caption-text">Stop the instance</p></div>
<p>Confirm in the pop-up window. Do not worry about losing storage because we did not set up any storage volumes.</p>
<div id="attachment_3139" style="width: 1034px" class="wp-caption aligncenter"><img src="http://i2.wp.com/www.brianlinkletter.com/wp-content/uploads/2015/01/AWS-017-1x.png?resize=1024%2C788" alt="17" class="size-large wp-image-3139" data-recalc-dims="1" /><p class="wp-caption-text">Confirm stopping the instance</p></div>
<p>Remember, when we start this instance again, we will have to use a new IP address when logging into the instance.</p>
<h3>AWS Console</h3>
<p>To access the management console for your VPS on Amazon AWS, log in using the AWS Console at the following URL: <a href="http://aws.amazon.com/console/">http://aws.amazon.com/console/</a>.</p>
    </body>
</html>
